<?php

/*
 *这个用于或者API.PHP 的请求方法
 */
namespace Piwik\Plugins\AdsPlace;


use Piwik\Plugins\AdsPlace\Model;
use Piwik\Common;
 
class ExtendAPI {
    private $model;
  
    //put your code here
    public function __construct(Model $model) {
        $this->model = $model;
        
    }
    public function getMedias()
    {
        $mediasId = Common::getRequestVar('idmedias','');
        $medias =  $this->model->getMediasById($mediasId);
        if(!empty($medias)){
             $medias['content'] = json_decode($medias['content'], true);
        } 
       
       // print_r( $medias);
        return  $medias ;
    }
}
